package com.androidx.p013lv.mine.novel.adpter;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import androidx.recyclerview.widget.RecyclerView;
import com.androidx.p013lv.base.bean.novel.LikeNovelBean;
import com.androidx.p013lv.base.recycler.BaseRecyclerAdapter;
import com.androidx.p013lv.base.recycler.BaseRecyclerHolder;
import com.androidx.p013lv.mine.C1207R;
import com.androidx.p013lv.mine.OnClickListenTypes;
import com.androidx.p013lv.mine.novel.view.LikeNovelOneView;
import com.androidx.p013lv.mine.novel.view.LikeNovelTwoView;

/* renamed from: com.androidx.lv.mine.novel.adpter.LikeNovelAdapterType */
public class LikeNovelAdapterType extends BaseRecyclerAdapter<LikeNovelBean.LikeNovelBeanData, Holder> {
    String domain;
    OnClickListenTypes onClickListenTypes;

    public LikeNovelAdapterType(OnClickListenTypes onClickListenTypes2) {
        this.onClickListenTypes = onClickListenTypes2;
    }

    public void setDomain(String str) {
        this.domain = str;
    }

    public void MyHolder(Holder holder, int i) {
        holder.setData((LikeNovelBean.LikeNovelBeanData) this.list.get(i), i, getItemViewType(i));
    }

    @Override // androidx.recyclerview.widget.RecyclerView.Adapter
    public int getItemViewType(int i) {
        return ((LikeNovelBean.LikeNovelBeanData) this.list.get(i)).getFictionType();
    }

    public void onViewRecycled(Holder holder) {
        super.onViewRecycled((RecyclerView.ViewHolder) holder);
    }

    @Override // androidx.recyclerview.widget.RecyclerView.Adapter
    public Holder onCreateViewHolder(ViewGroup viewGroup, int i) {
        View view;
        LayoutInflater from = LayoutInflater.from(viewGroup.getContext());
        if (i == 1) {
            view = from.inflate(C1207R.C1212layout.item_fiction_one, viewGroup, false);
        } else if (i != 2) {
            view = LayoutInflater.from(viewGroup.getContext()).inflate(C1207R.C1212layout.item_fiction_one, viewGroup, false);
        } else {
            view = from.inflate(C1207R.C1212layout.item_audio_novel_two, viewGroup, false);
        }
        return new Holder(view, i);
    }

    /* access modifiers changed from: package-private */
    /* renamed from: com.androidx.lv.mine.novel.adpter.LikeNovelAdapterType$Holder */
    public class Holder extends BaseRecyclerHolder {
        LikeNovelOneView oneView;
        LikeNovelTwoView twoView;

        public Holder(View view, int i) {
            super(view);
            if (i == 1) {
                this.oneView = new LikeNovelOneView(view, LikeNovelAdapterType.this.domain, LikeNovelAdapterType.this.onClickListenTypes);
            } else if (i == 2) {
                this.twoView = new LikeNovelTwoView(view, LikeNovelAdapterType.this.domain, LikeNovelAdapterType.this.onClickListenTypes);
            }
        }

        public void setData(LikeNovelBean.LikeNovelBeanData likeNovelBeanData, int i, int i2) {
            if (i2 == 1) {
                this.oneView.setView(likeNovelBeanData, i);
            } else if (i2 == 2) {
                this.twoView.setView(likeNovelBeanData, i);
            }
        }
    }
}
